<?php
// 应用公共文件

/**
 *  返回数据api
 * @param int $status
 * @param null $result
 * @param string $message
 * @param int $httpStatus
 * @return \think\response\Json
 */
function show($status = 1, $message = "", $result = [], $httpStatus = 200) {
    return json([
        "status" => $status,
        "message" => $message,
        "result" => $result
    ], $httpStatus);
}

function layShow($code = 0, $message = "", $filePath = "", $title = "", $httpStatus = 200) {
    return json([
        "code" => $code,
        "msg" => $message,
        "data" => [
            "src" => $filePath,
            "title" => $title,
        ]
    ], $httpStatus);
}